import { post, get } from '../utils/request'

export default {
    getUserInfo({ key = sessionStorage.getItem('key') } = {}) {
        return post('/okIf/me', { key })
    },
    getFriendList({ key = sessionStorage.getItem('key') } = {}) {
        return post('/okIf/friends', { key })
    },
    getFriendInfo({ key = sessionStorage.getItem('key'), user_id } = {}) {
        return post('/okIf/friend', { key, user_id })
    },
    getGroupList({ key = sessionStorage.getItem('key') } = {}) {
        return post('/okIf/groups', { key })
    },
    getGroupInfo({ key = sessionStorage.getItem('key'), group_id } = {}) {
        return post('/okIf/groupInfo', { key, group_id })
    },
    getGroupSubs({ key = sessionStorage.getItem('key'), group_id } = {}) {
        return post('/okIf/groupSubs', { key, group_id })
    },
    getSubOrder({ key = sessionStorage.getItem('key'), group_id } = {}) {
        return post('/okIf/subOrder', { key, group_id })
    },
    uploadImg(params) {
        return post('/file', params)
    },
    readTxt({ key = sessionStorage.getItem('key'), url } = {}) {
        return get('/readTxt', { key, url })
    }
}
